package com.caigou.service;

import com.caigou.bean.cms.entity.SurveyForm;
import com.caigou.bean.cms.entity.SurveyFormConfig;
import com.caigou.bean.cms.entity.SurveyQuestion;
import com.caigou.bean.cms.param.*;
import com.caigou.bean.exam.entity.Users;
import com.caigou.bean.param.ContentsParam;
import com.caigou.bean.param.SubmitSurveyFromParam;
import com.caigou.bean.param.SurveyPageParam;
import com.caigou.bean.vo.SurveyPageVO;
import com.caigou.bean.vo.SurveyQuestionVO;
import com.caigou.security.utils.CurrentUser;
import com.caigou.util.Result;
import com.github.pagehelper.PageInfo;
import org.aspectj.weaver.patterns.TypePatternQuestions;

import javax.servlet.http.HttpServletRequest;

public interface ISurveyService {

    SurveyForm getFormByFormId(String formId);

    SurveyFormHeader getFormHeader(String formId, Integer formType, Users user);

    Result removeFormInCatalog(String catalogId, String formId);

    Result updateIsEnableByFormId(SurveyFormParam param, Users user);

    Result deleteFormByFormId(SurveyFormParam param, Users user);

    SurveyForm getPreFormByFormType(Integer formType, Users user);

    SurveyFormConfig getSimpleSurveyFormConfigByFormId(String formId);

    SurveyFormConfig getSurveyFormConfigByFormId(String formId);

    int createOrUpdateSurveyFormConfig(SurveyFormConfigParam param, Users user);

    int updateSurveyFormSharePlatform(SurveyFormShardPlatformListParam param);

    int createSurveyFormConfig(SurveyFormConfigParam surveyFormConfigParam);

    int createDefaultSurveyFormConfig(String formId);

    PageInfo<SurveyForm> queryForm(QueryFormParam param);

    PageInfo<SurveyForm> queryForm4Catalog(QueryFormParam param);

    int createSurveyForm(SurveyFormParam param, Users user);

    int updateSurveyForm(SurveyFormParam param, Users user);

    int createOrUpdateSurveyForm(SurveyFormParam param, Users user);

    String getYktMiniQrCode(String path, String formId, String catalogId);

    String getYzbMiniQrCode(String path, String formId, String catalogId);

    Result createOrUpdateQuestionAndOption(QuestionAndOptionParam param);

    int deleteQuestionAndOption(QuestionParam param);

    int deleteOption(Option param);

    Result createOption(Option param);

    Result updateOption(Option param);

    Result moveOption(MoveOptionParam param);

    Result moveQuestion(MoveQuestionParam param);

    QuestionAndOptionParam getQuestionAndOption(Integer questionId);

    QuestionAndOptionParam getQuestionAndOption(SurveyQuestion surveyQuestion);

    FormParam getAllQuestionAndOptionByFormId(String formId);

    Result restoreForm(String formId);

    Result deleteFormFromRecycle(String formId, Users user);

    Result clearFormInRecycle(Users user);

    Result loadSurveyFormData(FrontSurveyParam param, HttpServletRequest request);

    Result loadSurveyFormOptionData(FrontSurveyParam param, HttpServletRequest request);

    Result submitFormAnswer(FrontSurveyParam param, HttpServletRequest request);

    Result copyForm(CopyFormParam param);

    Result loadSurveyFormStatistics(QueryFormParam param);

    Result loadSurveyFormStatisticsList(QueryFormParam param, @CurrentUser Users users);

    Result updateSurveyFormOptionSubmitCount(QueryFormParam param, @CurrentUser Users users);

    Result loadUserIsSubmit(FrontSurveyParam param);

    int updateSurveyFormConfig(String formId, Integer enableFormConfig);

    SurveyForm getSurveyFormHeaderByFormId(String formId);
}
